package com.example.kindergarten.dto


import io.swagger.annotations.ApiModelProperty
import org.hibernate.validator.constraints.Length
import java.io.Serializable
import javax.validation.constraints.*

open class HelloIdDto {
    @ApiModelProperty(value = "书籍id", required = true, notes = "书籍id", example = "1")
    @field: NotBlank(message = "书的唯一ID不能为空")
    var id: String = ""

}


class HelloInfoDto (

    @field: NotBlank(message = "书名不能为空")
    @field: Length(message = "书名长度必须大于1且小于50", min = 1, max = 50)
    var name: String,

    @field: NotBlank(message = "作者不能为空")
    var author: String,

    var description: String,

    var url: String,

    @field: NotBlank(message = "press不能为空")
    var press: String,

    @field: Email(message = "邮箱格式不正确")
    var email: String,

    @field: Max(value = 1000, message = "章节必须小于1000")
    @field: Min(value = 1, message = "章节必须大于1")
    var chapter: Long,

    @field: Max(value = 10000, message = "页数必须小于10000")
    @field: Min(value = 1, message = "页数必须大于1")
    var pages: Long,

    @field: Max(value = 1000 * 10000, message = "字数必须小于1000万")
    @field: Min(value = 10, message = "字数必须大于10")
    var words: Long,
):HelloIdDto()
